package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-16
 * Time: 11:14
 */
class A{
    public void func(){
        System.out.println("调用了A");
    }
    public A() {
        func();
    }
}
class B extends A{
    private int num = 1;

    @Override
    public void func() {
        System.out.println("调用了B  " + num);
    }
}
public class Test3 {
    public static void main(String[] args) {
        B b = new B();
    }
}
